{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_hkad/template/public/ygcsslist.css">
<style type="text/css">
    .yg5_key>div{float: left;line-height: 34px;}
    .store_td1{height: 45px;}
    .store_list_img{width: 60px;height: 60px;}
    .yg5_tabel{border-color: #e5e5e5;outline: 1px solid #e5e5e5;}
    .yg5_tr2>td{padding: 10px 15px;border: 1px solid #e5e5e5;text-align:center;}
    .yg5_tr1>th{
        border: 1px solid #e5e5e5;
        padding-left: 15px;
        background-color: #FAFAFA;
        font-weight: bold;
        text-align: center;
    }
    .yg5_btn{background-color: #EEEEEE;color: #333;border: 1px solid #E4E4E4;border-radius: 6px;width: 100px;height: 34px;}
    /*#frame-2{display: block;visibility: visible;}*/
</style>
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>    
    <li class="active"><a href="javascript:void(0)">活动列表</a></li>
    <li><a href="{php echo $this->createWebUrl('addlist')}">添加活动</a></li>
</ul>
<div class="main">
        <div class="panel panel-default ygdefault">
            <div class="panel-heading wyheader">
                活动管理&nbsp;>&nbsp;活动列表
            </div>
            <div class="panel-body" style="padding: 0px 15px;">

              <div class="row">
                <table class="yg5_tabel col-md-12">
                    <tr class="yg5_tr1" style="height: 50px">                
                        <th class="col-md-1">排序</th>                  
                        <th class="col-md-1">活动名称</th>               
                        <th class="col-md-1">活动时间</th>               
                        <th class="col-md-1">活动地址</th>             
                        <th class="col-md-1">活动费用</th>
                        <th class="col-md-1">创建时间</th>
                        <th class="col-md-2">操作</th>
                    </tr>
                    {loop $list $row}
                    <tr class="yg5_tr2">
                        <td>{$row['sort']}</td>
                        <td>{$row['title']}</td>
                        <td><p>{$row['ftime']}</p><p>{$row['totime']}</p></td>
                        <td>{$row['address']}</td>
                        <td>{$row['money']}</td>
                        <!-- <td>...{php echo mb_substr(strip_tags(htmlspecialchars_decode($row['img'])),-20,20,'utf-8')}</td> -->
                        <!-- <td>...{php echo mb_substr(strip_tags(htmlspecialchars_decode($row['link'])),-20,20,'utf-8')}</td> -->
                        <td>{$row['time']}</td>
                        <td>
                            {if $row['state']==1}
                            <a href="{php echo $this->createWebUrl('list', array('op' => 'abstatey', 'id' => $row['id']))}"><span class="btn ygyouhui2 btn-xs" id="btnx"><input type="hidden" value="{$row['id']}"><input style="border:none;background:none;" type="button" value="显示"></span></a>
                            {elseif $row['state']==0}
                            <a href="{php echo $this->createWebUrl('list', array('op' => 'abstatex', 'id' => $row['id']))}"><span class="btn ygshouqian2 btn-xs" id="btny"><input type="hidden" value="{$row['id']}"><input style="border:none;background:none;" type="button" value="隐藏"></span></a>
                            {/if}
                            
                            <a href="{php echo $this->createWebUrl('addlist', array('id' => $row['id']))}" class="storespan btn btn-xs">
                                <span class="fa fa-pencil"></span>
                                <span class="bianji">编辑<span class="arrowdown"></span>
                                </span>
                            
                            </a>
                            <a href="javascript:void(0);" class="storespan btn btn-xs" data-toggle="modal" data-target="#myModal{$row['id']}">
                                <span class="fa fa-trash-o"></span>
                                <span class="bianji">删除<span class="arrowdown"></span>
                                </span>
                            </a>
                        </td>
                    </tr>
                    <div class="modal fade" id="myModal{$row['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                      <div class="modal-dialog" role="document">
                        <div class="modal-content">
                          <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                          </div>
                          <div class="modal-body" style="font-size: 20px">
                            确定删除么？
                          </div>
                          <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                <a href="{php echo $this->createWebUrl('list', array('op' => 'delete', 'id' => $row['id']))}" type="button" class="btn btn-info" >确定</a>
                          </div>
                        </div>
                      </div>
                    </div>
                    
                    {/loop}
                </table>
              </div>
            </div>
        </div>
</div>
<script type="text/javascript">
    $(function(){
        // $("#frame-14").addClass("in");
        $("#frame-3").show();
        $("#yframe-3").addClass("wyactive");
        $(".tmdid").click(function(){
           var tmdid=windows.location.search.split("=")[1];
           console.log(tmdid);
        })
        // $("#btnx").click(function(){

        //     // $("#btnx input:nth-child(2)").val("隐藏");
        //     var statey=0;
        //     var id=$("#btnx input:nth-child(1)").val();
        //     // alert(id);
        //     $.ajax({
        //         type:"post",
        //         url:"{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=abstatey&m=zh_hkad",
        //         dataType:"json",
        //         async: true,
        //         data:{state:statey,id:id},
        //         success:function(data){  
        //             // console.log(data);
        //         // alert(data.res.state);    
        //             // location.reload(); 
        //             // window.location.href="{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=list&m=zh_hkad";
        //         }
        //     })
        // });
        // $("#btny").click(function(){

        //     // $("#btnx input:nth-child(2)").val("显示");
        //     var statex=1;
        //     var id=$("#btny input:nth-child(1)").val();
        //     // alert(id);
        //     $.ajax({
        //         type:"post",
        //         url:"{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=abstatex&m=zh_hkad",
        //         dataType:"json",
        //         async: true,
        //         data:{state:statex,id:id},
        //         success:function(data){    
        //             // location.reload();
        //             // console.log(data);
        //         // alert(data.res.state);  
        //             // window.location.href="{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=list&m=zh_hkad";
        //         }
        //     })
        // });

        // $("#btnxy").click(function(){
        //     // var state=1;
        //     var id=$("#btnxy input:nth-child(1)").val();
        //     var state=$("#btnxy input:nth-child(2)").val();
        //     if(state==0){
        //         state=1;
        //         $.ajax({
        //             type:"post",
        //             url:"{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=abstatex&m=zh_hkad",
        //             dataType:"json",
        //             // async: true,
        //             data:{state:state,id:id},
        //             success:function(data){    
        //                 location.reload();

        //                 // $(".state").val();
        //                 // window.location.href="{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=list&m=zh_hkad";
        //             }
        //         })
        //     }
        //     if(state==1){
        //         state=0;
        //         $.ajax({
        //             type:"post",
        //             url:"{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=abstatex&m=zh_hkad",
        //             dataType:"json",
        //             // async: true,
        //             data:{state:state,id:id},
        //             success:function(data){    
        //                 location.reload();

        //                 // $(".state").val();
        //                 // window.location.href="{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=list&m=zh_hkad";
        //             }
        //         })
        //     }
        // });
    })
</script>